package com.lg.partition19;

import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author `RKC`
 * @date 2022/3/16 16:52
 */
public class P1896互不侵犯 {

    private static final int N = 12, K = N * N;
    //f[i][j][k]表示考虑前i层，当前层的状态是j，且已经放置k个国王的合法方案数
    private static long[][][] f = new long[N][1 << N][K];
    private static Map<Integer, List<Integer>> map = new HashMap<>(1 << N);
    private static int n, k;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String[] ss = reader.readLine().split(" ");
        n = Integer.parseInt(ss[0]);
        k = Integer.parseInt(ss[1]);
        //预处理出来单行的合法状态
        for (int i = 0; i < 1 << n; i++) {
            if ((i & (i << 1)) != 0 || (i & (i >> 1)) != 0) continue;
            map.put(i, new ArrayList<>());
        }
        //预处理在当前行合法的情况下上一行的所有状态
        for (int cur : map.keySet()) {
            List<Integer> ps = map.get(cur);
            for (int prev : map.keySet()) {
                if ((cur & prev) != 0 || ((cur << 1) & prev) != 0 || ((cur >> 1) & prev) != 0) continue;
                ps.add(prev);
            }
        }
        f[0][0][0] = 1;
        for (int i = 1; i <= n + 1; i++) {
            for (Map.Entry<Integer, List<Integer>> entry : map.entrySet()) {
                int cur = entry.getKey(), cnt = bitCount(cur);
                for (int prev : entry.getValue()) {
                    for (int u = cnt; u <= k; u++) {
                        f[i][cur][u] += f[i - 1][prev][u - cnt];
                    }
                }
            }
        }
        writer.write(f[n + 1][0][k] + "\n");
        writer.flush();
    }

    private static int bitCount(int x) {
        int res = 0;
        while (x != 0) {
            res++;
            x -= x & -x;
        }
        return res;
    }
}
